package com.quectel.business.common.websocket.send;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.function.Function;

/**
 * 消息类型
 *
 * @author: caolu
 * @email: louis.cao@quectel.com
 * @date: 2023-05-18 16:19:00
 */
@AllArgsConstructor
public enum SendMsgType {

    /**
     * 注册成功
     */
    REGISTER_SUCCESS("registerSuccess", null, null),

    /**
     * 注册失败
     */
    REGISTER_FAILED("registerFailed", null, null),

    /**
     * 响应
     */
    PONG("pong", null, null),

    /**
     * 重点人群进出
     */
    FOCUS("focusAccess","重点人员进出", strings -> String.format("重点人员 %s 在 %s 进出 %s 位置",strings[0], strings[1], strings[2])),

    /**
     * 设备告警
     */
    DEVICE_ALARM("deviceAlarm","设备告警", strings -> String.format("设备 %s 在 %s 触发了 %s 告警",strings[0], strings[1], strings[2])),

    /**
     * 人车预警
     */
    PRE_WARN("preWarn","人车预警", strings -> String.format("%s 在 %s 触发了 %s 预警",strings[0], strings[1], strings[2]));

    @Getter
    private String msgTypeFlag;

    @Getter
    private String title;

    @Getter
    private Function<String[], String> contentFunc;


}
